﻿<?php include_once 'includes/header.php'; ?>
<div id="wrap">
  <div id="main">
    <div class="top"></div>
    <div id="mainarea">
      <h2 class="title">邀请</h2>
      <style type="text/css">

#fixed{position:fixed;top:5em;right:0;}

.more{
    display:none;
    background-color:#fdfef9;
    height:98px;
    color:#000;
    border:#eee solid 2px;
    font-size:12px;
    padding:5px 5px;
    position:absolute;
    line-height:22px;
}
.divbox
{/*提供一个相对节点，让弹出层相对它绝对定位；*/
    height:0px;
    line-height:0;
    font-size:0;
    position:relative;
}
#groupName{
	border:0px;
}
</style>
      <div class="tabs_header">
        <ul class="tabs">
          
          <!-- 联保体修改 -->
          <li class="active"> <a href="loanUnite_toManager.action"><span>我的联保体</span> </a> </li>
          <li> <a href="Enterprise_toBusiSearch.action"><span>搜索企业</span> </a> </li>
          <li> <a href="Message_findAll.action"><span>消息中心</span> </a> </li>
        </ul>
      </div>
      
      <!--选项卡为邀请成员  --> 
      
      <script type="text/javascript" src="http://sns.quanqiuwang.com.cn:80//image/contact/contact.js" charset="utf-8"></script> 
      <script src="http://sns.quanqiuwang.com.cn:80//source/jquery-1.4.4.min.js" type="text/javascript"></script> 
      <script type="text/javascript" src="/source/ymPrompt.js"></script>
      <link rel="stylesheet" id="skin" type="text/css" href="/source/skin/qq/ymPrompt.css">
      <style type="text/css">
.multipleSelectBoxControl span { /* Labels above select boxes*/
	font-family: arial;
	font-size: 12px;
}

.multipleSelectBoxControl div select { /* Select box layout */
	font-family: arial;
	height: 100%;
}

.multipleSelectBoxControl input { /* Small butons */
	width: 25px;
}
.multipleSelectBoxDiv span{padding:10px;}

.multipleSelectBoxControl div {
	float: left;
}
.multipleSelectBoxDiv
</style>
      <script type="text/javascript">           
var fromBoxArray = new Array();    
 var toBoxArray = new Array();     
 var selectBoxIndex = 0;      
  function moveSingleElement()     { 
          var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');
          var tmpFromBox;
          var tmpToBox;        
		if(this.tagName.toLowerCase()=='select'){    
		         tmpFromBox = this;       
		         if(tmpFromBox==fromBoxArray[selectBoxIndex])tmpToBox = toBoxArray[selectBoxIndex]; else tmpToBox = fromBoxArray[selectBoxIndex];         }else{               if(this.value.indexOf('>')>=0){                 tmpFromBox = fromBoxArray[selectBoxIndex];                 tmpToBox = toBoxArray[selectBoxIndex];             }else{                 tmpFromBox = toBoxArray[selectBoxIndex];                 tmpToBox = fromBoxArray[selectBoxIndex];             }         }           for(var no=0;no<tmpFromBox.options.length;no++){             if(tmpFromBox.options[no].selected){                 tmpFromBox.options[no].selected = false;                 tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);                   for(var no2=no;no2<(tmpFromBox.options.length-1);no2++){                     tmpFromBox.options[no2].value = tmpFromBox.options[no2+1].value;                     tmpFromBox.options[no2].text = tmpFromBox.options[no2+1].text;                     tmpFromBox.options[no2].selected = tmpFromBox.options[no2+1].selected;                 }                 no = no -1;                 tmpFromBox.options.length = tmpFromBox.options.length-1;               }         }           var tmpTextArray = new Array();         for(var no=0;no<tmpFromBox.options.length;no++){             tmpTextArray.push(tmpFromBox.options[no].text + '___' + tmpFromBox.options[no].value);         }         tmpTextArray.sort();         var tmpTextArray2 = new Array();         for(var no=0;no<tmpToBox.options.length;no++){             tmpTextArray2.push(tmpToBox.options[no].text + '___' + tmpToBox.options[no].value);         }         tmpTextArray2.sort();           for(var no=0;no<tmpTextArray.length;no++){             var items = tmpTextArray[no].split('___');             tmpFromBox.options[no] = new Option(items[0],items[1]);           }                  for(var no=0;no<tmpTextArray2.length;no++){             var items = tmpTextArray2[no].split('___');             tmpToBox.options[no] = new Option(items[0],items[1]);         }     }       function moveAllElements()     {         var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');         var tmpFromBox;         var tmpToBox;         if(this.value.indexOf('>')>=0){             tmpFromBox = fromBoxArray[selectBoxIndex];             tmpToBox = toBoxArray[selectBoxIndex];         }else{             tmpFromBox = toBoxArray[selectBoxIndex];             tmpToBox = fromBoxArray[selectBoxIndex];         }           for(var no=0;no<tmpFromBox.options.length;no++){             tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);         }              tmpFromBox.options.length=0;       }       function createMovableOptions(fromBox,toBox,totalWidth,totalHeight,labelLeft,labelRight)     {         fromObj = document.getElementById(fromBox);         toObj = document.getElementById(toBox);           fromObj.ondblclick = moveSingleElement;         toObj.ondblclick = moveSingleElement;           fromBoxArray.push(fromObj);         toBoxArray.push(toObj);           var parentEl = fromObj.parentNode;           var parentDiv = document.createElement('DIV');         parentDiv.className='multipleSelectBoxControl';         parentDiv.id = 'selectBoxGroup' + selectBoxIndex;         parentDiv.style.width = totalWidth + 'px';         parentDiv.style.height = totalHeight + 'px';         parentEl.insertBefore(parentDiv,fromObj);           var subDiv = document.createElement('DIV');         subDiv.style.width = (Math.floor(totalWidth/2) - 20) + 'px';         fromObj.style.width = (Math.floor(totalWidth/2) - 20) + 'px';           var label = document.createElement('SPAN');         label.innerHTML = labelLeft;         subDiv.appendChild(label);           subDiv.appendChild(fromObj);         subDiv.className = 'multipleSelectBoxDiv';         parentDiv.appendChild(subDiv);           var buttonDiv = document.createElement('DIV');         buttonDiv.style.verticalAlign = 'middle';         buttonDiv.style.paddingTop = (totalHeight/2) - 50 + 'px';         buttonDiv.style.width = '30px';         buttonDiv.style.textAlign = 'center';         parentDiv.appendChild(buttonDiv);           var buttonRight = document.createElement('INPUT');         buttonRight.type='button';         buttonRight.value = '>';         buttonDiv.appendChild(buttonRight);         buttonRight.onclick = moveSingleElement;               var buttonAllRight = document.createElement('INPUT');         buttonAllRight.type='button';         buttonAllRight.value = '>>';         buttonAllRight.onclick = moveAllElements;         buttonDiv.appendChild(buttonAllRight);                 var buttonLeft = document.createElement('INPUT');         buttonLeft.style.marginTop='10px';         buttonLeft.type='button';         buttonLeft.value = '<';         buttonLeft.onclick = moveSingleElement;         buttonDiv.appendChild(buttonLeft);                 var buttonAllLeft = document.createElement('INPUT');         buttonAllLeft.type='button';         buttonAllLeft.value = '<<';         buttonAllLeft.onclick = moveAllElements;         buttonDiv.appendChild(buttonAllLeft);           var subDiv = document.createElement('DIV');         subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px';         toObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px';           var label = document.createElement('SPAN');         label.innerHTML = labelRight;         subDiv.appendChild(label);           subDiv.appendChild(toObj);         parentDiv.appendChild(subDiv);                 toObj.style.height = (totalHeight - label.offsetHeight) + 'px';         fromObj.style.height = (totalHeight - label.offsetHeight) + 'px';           selectBoxIndex++;       }       </script> 
      <script type="text/javascript"> 
function selectItem(){  
	var obj = document.getElementById("toBox");      
	var result = "";　
	for(var no=0;no<obj.options.length;no++){  
			var enterpriseId=obj.options[no].value;
			var enterpriseName=obj.options[no].text;
			if(no==obj.options.length-1)
				result+=enterpriseId+","+enterpriseName;
			else
				result+=enterpriseId+","+enterpriseName+";";
			obj.options[no].selected = true;  
   } 
	document.getElementById("enterprises").value=result;
	 document.myForm.action="Enterprise_inviteList.action";
	 document.myForm.submit();
 }
</script> 
      <script type="text/javascript">
<!--
	function getDisplay(obj){
		var arrayObj = new Array("listtable","mailtable","invitetable"); 
		for(i in arrayObj){
			if(arrayObj[i] == obj){
				document.getElementById(arrayObj[i]).style.display = 'block';
			}else{
				document.getElementById(arrayObj[i]).style.display = 'none';
			}
		}
	}
	function gotoSelect(obj,objText,objValue){
		var y=document.createElement('option');
		y.value = objValue;
		y.text = objText;
		var selectValue = document.getElementById(obj);
		try{
			selectValue.add(y,null); // standards compliant
		}catch(ex){
			selectValue.add(y); // IE only
		}
	}
	function removeOption(obj1,obj2){
		var x1 = document.getElementById(obj1); 
		var values = x1.options[x1.selectedIndex].value;
		var text = x1.options[x1.selectedIndex].text;
		x1.remove(x1.selectedIndex);
		gotoSelect(obj2,values,text);
	} 
	//获取第二的select的值
		function getValues(obj){
		 var x=document.getElementById(obj);
		  var y="";
		  for (i=0;i<x.length;i++)
			{
			y+=x.options[i].value;
			y+="<br />";
			}
		  document.write(y);
		  }
	function oCopy(){ 
	var obj=document.getElementById("inviteLine");
		obj.select(); 
		js=obj.createTextRange(); 
		js.execCommand("Copy");
		//window.clipboardData.setData('text', obj.value); 
		ymPrompt.succeedInfo("复制成功!",300,190,null,null);
	} 
	
//-->
</script>
      <form action="#" method="post" name="myForm">
        <table class="jtable" border="0" cellspacing="0" cellpadding="0" width="100%">
            <tbody>
          
          <tr valign="top">
            <td><table class="jtable" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td><a href="#" onclick="getDisplay('listtable')" style="text-decoration: none;">从关注列表导入</a></td>
                  </tr>
                  <tr>
                    <td><a href="#" onclick="getDisplay('mailtable')" style="text-decoration: none">从邮箱邀请</a></td>
                  </tr>
                  <tr>
                    <td><a href="#" onclick="getDisplay('invitetable')" style="text-decoration: none">邀请联系人</a></td>
                  </tr>
                </tbody>
              </table></td>
            <td style="width: 80%"><table class="" border="0" width="100%" cellspacing="0" cellpadding="0" id="listtable" style="display: block">
                <tbody>
                  <tr>
                    <td width="99%" align="center" style="border:none;"><div class="multipleSelectBoxControl" id="selectBoxGroup0" style="width: 400px; height: 300px; ">
                        <div style="width: 180px; " class="multipleSelectBoxDiv">
                          <select multiple="" name="fromBox" id="fromBox" style="width: 180px; height: 285px; ">
                          </select>
                        </div>
                        <div style="width: 185px; ">
                          <select name="toBox" id="toBox" multiple="multiple" style="width: 185px; height: 285px; ">
                          </select>
                        </div>
                      </div></td>
                  </tr>
                  <tr>
                    <td class="tdLabel" style="border-right:none;"></td>
                    <input type="hidden" id="__multiselect_toBox" name="__multiselect_toBox" value="">
                  </tr>
                <input type="hidden" name="enterprises" id="enterprises">
                <script type="text/javascript"> createMovableOptions("fromBox","toBox",400,300,'联保体关注列表','邀请成员列表'); </script>
                <tr>
                  <td align="center" style="border:none;"><input type="button" value="下一步" class="submit" onclick="getDisplay('mailtable')">
                    <input type="button" value="返回" onclick="window.history.go(-1)" class="submit"></td>
                </tr>
                  </tbody>
                
              </table>
              <table id="mailtable" style="display: none" class="jtable" border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                  <tr>
                    <td><div class="r_option"><a href="#" onclick="MYCONTACT.showChooser('email', false,null); return false"><img src="image/contact/contact_button.gif" style="margin: 5px 0 0;" alt="从地址簿添加"></a></div>
                      <div><br>
                        好友Email地址</div>
                      <textarea name="email" id="email" rows="5" cols="60" style="width:99%;"></textarea></td>
                  </tr>
                  <tr align="left">
                    <td> 想对好友说的话<br>
                      <input type="text" name="saymsg" id="saymsg" onkeyup="showPreview(this.value, 'sayPreview')" class="t_input" style="width:98%;"></td>
                  </tr>
                  <tr>
                    <td colspan="3" align="left"><input name="button" type="button" value="下一步" onclick="getDisplay('invitetable')" class="submit">
                      
                      <!--  onclick="getDisplay('invitetable')"/>-->
                      
                      <input type="button" value="返回" onclick="window.history.go(-1)" class="submit"></td>
                  </tr>
                </tbody>
              </table>
              <table style="display: none" id="invitetable" width="100%" class="jtable" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td> 这是你的专业邀请链接，赶紧发给你的朋友吧 </td>
                  </tr>
                  <tr>
                    <td><input type="text" id="inviteLine" name="inviteLine" size="45" value="http://sns.quanqiuwang.com.cn/loanUnite_entity.action?loanUniteVO.loanUniteId=100080" readonly="readonly">
                      <input type="button" onclick="oCopy()" value="复制"></td>
                    
                  </tr>
                  <tr>
                    <td colspan="3" align="left"><input name="button" type="button" value="完成" onclick="selectItem()" class="submit">
                      <input type="button" value="返回" onclick="window.history.go(-1)" class="submit"></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
            </tbody>
          
        </table>
      </form>
    </div>
    <div class="bot"></div>
  </div>
  <?php include_once 'includes/sidebar_group.php'; ?>
</div>
